﻿#pragma once

#ifndef BAS_AIRPORT_H
#define BAS_AIRPORT_H

#include "ICPUtility.h"
class BasAirportBreak;
class BasAirportTransfer;
class BasAirportNight;

class BasAirport {
  private:
    static int _countId;

    int _id;
    string _code3;

    BasAirportBreak* _basAirportBreak; // 该机场是否为可二次进场机场，如果是，则该对象存储二次进场标准
    BasAirportTransfer* _basAirportTransfer; // 该机场是否为可换机机场，如果是，则该对象存储换机机场过站时间标准
    BasAirportNight* _basAirportNight; // 该机场是否为过夜机场，如果是，则该对象存储过夜进场标准
    bool _isBase;                      // 是否基地
    D_OR_I _dori;
    SP_LEVEL _spLevel; // 特殊机场等级
    time_t _zoneTime;  // 时区
  public:
    BasAirport(string code3, D_OR_I dori, SP_LEVEL spLevel, time_t zoneTime);

    ~BasAirport();

    int getId() { return _id; }
    string getCode3() { return _code3; }

    D_OR_I getDorI() { return _dori; }
    SP_LEVEL getSpLevel() { return _spLevel; }
    time_t getZoneTime() { return _zoneTime; }
    bool isDomestic();
    bool fsbChgAft() { return _basAirportTransfer != NULL; }
    bool fsbOvernight() { return _basAirportNight != NULL; }
    void setIsBase(bool value) { _isBase = value; }
    bool isBase() { return _isBase; }
    bool isHard() { return false; }

    BasAirportBreak* getBasAirportBreak() { return _basAirportBreak; }
    BasAirportTransfer* getBasAirportTransfer() { return _basAirportTransfer; }
    BasAirportNight* getBasAirportNight() { return _basAirportNight; }
    void setBasAirportBreak(BasAirportBreak* value) { _basAirportBreak = value; }
    void setBasAirportTransfer(BasAirportTransfer* value) { _basAirportTransfer = value; }
    void setBasAirportNight(BasAirportNight* value) { _basAirportNight = value; }

    void print();
};

#endif // !BAS_AIRPORT_H